一、获取安装文件

$ pwd
/user/***
$ wget http://download.redis.io/releases/redis-3.2.3.tar.gz

二、解压文件并移动文件

$ tar xzf redis-3.2.3.tar.gz
$ mv redis-3.2.3 /usr/local/redis

三、进入文件夹目录

$ cd /usr/local/redis

四、编译安装

$ make 

五、安装依赖包

$ cd src && make test
You need tcl 8.5 or newer in order to run the Redis test
make: *** [test] 错误 1

$ yum install tcl
已加载插件:fastestmirror, security
设置安装进程
Loading mirror speeds from cached hostfile
.............

六、再次编译安装

$ make 
$ cd src 
$ make test

七、make test报错及修改

[err]: Test replication partial resync: ok psync (diskless: yes, reconnect: 1) in tests/integration/replication-psync.tcl

Expected condition '[s -1 sync_partial_ok] > 0' to be true ([s -1 sync_partial_ok] > 0)

出现这个问题的原因可能是"测试点在配置比较低的机器上会因为超时而过不了"  

在解压目录中修改
# vi tests/integration/replication-psync.tcl
把 after 100 改成 after 500

八、设置配置文件路径

$ mkdir /etc/redis
$ cp /usr/local/redis/redis.conf /etc/redis

九、加入开机启动

echo "/usr/local/redis/src/redis-server /etc/redis/redis.conf &" >> /etc/rc.local

十、启动redis-server 及redsi-cli

$ /usr/local/redis/src/redis-server /etc/redis/redis.conf &

$ /usr/local/redis/src/redis-cli 

wumahoo
184 声望5 粉丝

知其然而知其所以然